The present invention relates generally to the field of compiling source code, and more particularly to optimizing the compiling of a template function.
A compiler is a program, or set of programs, that transforms source code written in a programming language (i.e., the source language) into another computer language (i.e., the target language, often having a binary form known as object code). A common reason for converting source code is to create an executable program. More generally, a compiler is a specific type of translator.
A template function behaves like a standard function except that the template can have data of many different types; each data type may have one or more parameters. In other words, a template function represents a family of functions. A template function allows a programmer to code a single function to work on multiple data types which results in the compiler executing the function on the various data types rather than the programmer writing individual functions for each data type.